// JavaScript Document

function toggleButtons(val) {
    if (val == 0) {
        document.getElementById("dailyupdateslight").style.zIndex = "1";
        document.getElementById("dailyupdatesdark").style.zIndex = "2";
    }
    else if (val == 1) {
        document.getElementById("findreportslight").style.zIndex = "1";
        document.getElementById("findreportsdark").style.zIndex = "2";
    }
    else if (val == 2) {
        document.getElementById("reportladderlight").style.zIndex = "1";
        document.getElementById("reportladderdark").style.zIndex = "2";
    }
    else if (val == 3) {
        document.getElementById("aboutlight").style.zIndex = "1";
        document.getElementById("aboutdark").style.zIndex = "2";
    }
    else if (val == 4) {
        document.getElementById("contactlight").style.zIndex = "1";
        document.getElementById("contactdark").style.zIndex = "2";
    }
    else if (val == 5) {
        document.getElementById("dailyupdateslight").style.zIndex = "2";
        document.getElementById("dailyupdatesdark").style.zIndex = "1";
    }
    else if (val == 6) {
        document.getElementById("findreportslight").style.zIndex = "2";
        document.getElementById("findreportsdark").style.zIndex = "1";
    }
    else if (val == 7) {
        document.getElementById("reportladderlight").style.zIndex = "2";
        document.getElementById("reportladderdark").style.zIndex = "1";
    }
    else if (val == 8) {
        document.getElementById("aboutlight").style.zIndex = "2";
        document.getElementById("aboutdark").style.zIndex = "1";
    }
    else if (val == 9) {
        document.getElementById("contactlight").style.zIndex = "2";
        document.getElementById("contactdark").style.zIndex = "1";
    }
    else if (val == 10) {
        document.getElementById("trianglelight").style.zIndex = "2";
        document.getElementById("triangledark").style.zIndex = "1";
    }
    else if (val == 11) {
        if (!userClicked) {
            document.getElementById("trianglelight").style.zIndex = "1";
            document.getElementById("triangledark").style.zIndex = "2";
        }
    }
}

function toggleUserBox(val) {
    if (val == 0) {
        document.getElementById("userbox").style.display = "block";
        document.getElementById("triangle").style.zIndex = "1";
        document.getElementById("trianglerotated").style.zIndex = "2";
    }
    else {
        document.getElementById("userbox").style.display = "none";
        document.getElementById("triangle").style.zIndex = "2";
        document.getElementById("trianglerotated").style.zIndex = "1";
    }
}

function changeColor(tableRow, toggleColor) {
    if (toggleColor) {
        tableRow.style.backgroundColor = '#dcfac9';
    }
    else {
        tableRow.style.backgroundColor = 'white';
    }
}

function followLink(url) {
    var temp = document.location.href;
    var containsHome = temp.indexOf("Home");
    if (containsHome != -1)
    {
        temp = temp.substring(0, containsHome);
    }
    document.location.href = temp + url;
}

